home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C++ / Applications / PICSee Dust 1.01 / Quaternary Source / Class_ProgressBar.h < prev    next >
Text File  |  1995-11-13  |  1KB  |  42 lines

  1. #ifndef CLASS_PROGRESSBAR_H_
  2. #define CLASS_PROGRESSBAR_H_
  3.  
  4. typedef class ProgressBar {
  5.     public:
  6.             // "B&W" version
  7.         ProgressBar(Rect *theBounds, short max, short cur, GrafPtr owner);
  8.             // Color version
  9.         ProgressBar(Rect *theBounds, short max, short cur, GrafPtr owner,
  10.             RGBColor *fill, RGBColor *bkgnd);
  11.  
  12.         virtual void Update();                        // Draw without incrementing
  13.         virtual void Increment();                    // Increment & then draw
  14.         virtual void IncrementBy(short stepValue);    // Increment by adding stepValue, then draw
  15.         virtual void IncrementTo(short newCurVal);    // Increment to newCurVal & then draw
  16.  
  17.         virtual void SetStep(short step)                { stepVal = step; }
  18.         virtual void SetFillColor(RGBColor *newColor)    { fillColor = *newColor; }
  19.         virtual void SetBkgndColor(RGBColor *newColor)    { bkgndColor = *newColor; }
  20.         virtual void SetSmoothUpdate(Boolean smooth)    { smoothProgress = smooth; }
  21.         virtual Boolean IsDone()                        { return(curVal >= maxVal); }
  22.  
  23.     protected:
  24.         GrafPtr ownerPort;
  25.         Rect bkgndRect, fillRect, frameRect;
  26.         short maxVal;
  27.         short curVal;
  28.         short stepVal;            // Defaults to 1.
  29.         Boolean smoothProgress;    // Fill up every pixel or just jump to current value?
  30.                                 // Default to true.
  31.         Boolean setupYet;
  32.         
  33.         Boolean useFillColor;    // Default to false (if not specified)
  34.         Boolean useBkgndColor;    // Ditto
  35.  
  36.         RGBColor fillColor;
  37.         RGBColor bkgndColor;
  38.  
  39.         virtual void Draw();
  40. } *ProgressBarPtr, **ProgressBarHdl;
  41.  
  42. #endif // CLASS_PROGRESSBAR_H_